Create vcap_services.json to capture Bluemix VCAP service credential

Usage:

  • In Bluemix, create Streaming Analytics service
  • Open the Streaming Analytics service
  • Click Service Credentials tab
  • Click New Credential button (if one is not already available)
  • Copy the Key Name and Credentials into the cells below
  • Run all cells to create vcap_services.json

In [ ]:
key_name='Streaming-Analytics'
credentials={}

In [ ]:
import json

vs = {
    'streaming-analytics': [
        {
            'name': key_name,
            'credentials': credentials
        }
    ]
}
with open ('vcap_services.json', 'w') as outfile:
    json.dump(vs, outfile)

In [ ]: